<?php $this->headScript()->captureStart() ?>
$(document).ready(function(){
    var options = { 
        type:"POST",
        dataType : "text",
        buttons:$('#profileForm').find("button[name='button']"),
        async : true,
        cache: false,
        success:function(responseText, statusText)
        {
            var json = jQuery.parseJSON(responseText);
            if(json.result != 1){
                dialogMessage(json.messages);
                return false;
            }
            
            dialogTip(json.messages);
            return true;
        },
    };
    var v = jQuery("#profileForm").validate({
        debug: true,
        messages: {
            nickname: {
                required: "<?php echo $this->translate("Please enter a nickname.");?>",
            },
        },
        rules: {
            nickname: {
                required: true,
            },
        },
        errorPlacement: function(error, element) {
            var elementName = element.attr("name");
            var idTip = 'tip-' + elementName;
            $("#" + idTip).html(error);
        },
        success: function(label) {
            label.addClass("valid").text("Ok!");
        },
        submitHandler: function(form) {
            jQuery(form).ajaxSubmit(options);
        }
    });
});
<?php $this->headScript()->captureEnd() ?>

<div class="container">
    <div class="column span-18 colborder">
        <?php echo $this->form;?>
    </div>
    <div class="column span-5 last">
       <?php echo $this->render('module_setup_script_sidebar.phtml');?>
    </div>
 </div>

